Skip to content

chore: masking at the top of the trace#22334

Open
iakovenkos wants to merge 42 commits intomerge-train/barretenbergfrom
si/eccvm-lagrange-last-integer
Open

chore: masking at the top of the trace#22334
iakovenkos wants to merge 42 commits intomerge-train/barretenbergfrom
si/eccvm-lagrange-last-integer

Conversation

@iakovenkos
Copy link
Copy Markdown
Contributor

.

…ay from RDP

With top-of-trace masking, the row-disabling polynomial 1 - ∏_{i≥2}(1-u_i)
is circuit-size independent. The verifier evaluates it over ALL D challenges
without needing log_circuit_size or padding_indicator_array.

Prover: ZK virtual rounds now use compute_virtual_contribution * (1-L) + libra
instead of sending zero univariates. Libra univariates cover all D rounds.

Verifier: apply_zk_corrections evaluates RDP from challenge vector size.
compute_padding_indicator_array returns all-1s (unified path).
@iakovenkos iakovenkos self-assigned this Apr 9, 2026
@iakovenkos iakovenkos added the ci-full Run all master checks. label Apr 9, 2026
notnotraju added a commit that referenced this pull request Apr 10, 2026
…22461)

## Summary

Add `lagrange_first * transcript_accumulator_not_empty = 0` subrelation
to `ECCVMTranscriptRelation`.

This is a prerequisite for #22334 (masking at top of ECCVM circuit). The
audit in #22442 identified that when `lagrange_first` moves to row k
(away from the PCS-enforced zero row),
`transcript_accumulator_not_empty` is the only shiftable column where a
malicious prover can potentially set a non-zero value at the
`lagrange_first` row without any existing relation catching it. Setting
it to 1 disables `INFINITY_ACC_X/Y`, allowing arbitrary accumulator
coordinates to be injected.

## Changes

- New subrelation `ACCUMULATOR_NOT_EMPTY_INIT` in
`ecc_transcript_relation.hpp` (degree 2)
- Gate count updates (+174 gates from the new subrelation):
  - `ECCVM_RECURSIVE_VERIFIER_GATE_COUNT`: 224336 → 224510
  - `CHONK_RECURSION_GATES`: 1491593 → 1491767

## Test plan

- [x] `eccvm_tests` — all 44 tests pass
- [x] `stdlib_eccvm_verifier_tests` — `SingleRecursiveVerification`
passes with updated gate count
- [x] `dsl_tests` — `GateCountChonkRecursion` passes with updated gate
count

Co-authored-by: notnotraju <raju@aztec-labs.com>
// Override VIRTUAL_LOG_N for the AVM recursive verifier circuit
static constexpr size_t VIRTUAL_LOG_N = MEGA_AVM_LOG_N;

// AVM doesn't use ZK masking, so no disabled rows are needed. Setting TRACE_OFFSET=0
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's annoying but seems like the only way to keep TwoLayerAVMRecursiveVerifier intact without introducing an extra merge. The reason is that mega by default would commit to ecc op wires as [0, 0, 0, 0, *] and pass those directly to Translator, that operates on the op queue without the zeroes. in chonk, merge takes care of unshifting the final table, in avm we use the old layout of mega circuits

@iakovenkos iakovenkos requested a review from notnotraju April 13, 2026 10:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci-full Run all master checks.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant